<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Math
{
    public static function percent($num_amount, $num_total) {
        $count1 = $num_amount / $num_total;
        $count2 = $count1 * 100;
        $count = number_format($count2, 0);
        return $count;
    }

    public static function percentDiscount($num_amount, $num_total) {
        $count1 = $num_amount / $num_total;
        $count2 = 100 - $count1 * 100;
        $count = number_format($count2, 0);
        return $count;
    }

    public static function getRemiitableAmount($commission_rate, $price) {
        $commission = $commission_rate * .01;
        $item_cost = $price * $commission;
        $amount = $price - $item_cost;
        return $amount;
    }
}
?>
